﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LSData;
using MathematicsEntity;

namespace MathematicsData
{
    public class KSBData : DataBase
    {
        /// <summary>
        /// 练习数据
        /// </summary>
        /// <returns></returns>
        public static List<TestReportDataEntity> TestReportData()
        {
            var sql =
                String.Format(
                    @"select count(*) as PeopleCount,
                                c.ID as ClassId,
                                c.Name as ClassName,
                                sum(accuracy)/count(*) as AverageRight,
                                sum(questionCorrect)*5/count(*) as AveragePoint  
                                        from webgame_math_kousuanbao_log as wmkl 
                                        join account_class_mapping as acm on acm.Account_ID=wmkl.userId
                                        join class as c on c.ID=acm.Class_ID
                                        group by c.ID");
            return GetList<TestReportDataEntity>(sql, EConn).ToList();
        }
    }
}
